class Person:
    def __init__(self, name, age):
        self.name = name
        # self.__age = age
        self.age = age

    @property
    def age(self):
        return self.__age

    @age.setter
    def age(self, age):
        if not (0 <= age <= 120):
            raise "年龄有误"
        self.__age = age


zs = Person("张三", 10)
print(zs.age)
zs.age = 29
print(zs.age)
zs.age = 229
print(zs.age)
